--Misc functions which do not belong in any specific file
--Many taken from lua-users.org and either modified, renamed, or otherwise made to work for me

function trimstring(s)
  return (s:gsub("^%s*(.-)%s*$", "%1"))
end

function ltrim(s)
  return (s:gsub("^%s*", ""))
end

function Stygian_gagChat()
  if chat_hasChat_flag and Stygian.config.gagChat then
	  deleteLine()
  	global_gag_prompt = true
  end
end

Stygian_potionHash = {
  ["a potion of allheale"] = "allheale",
  ["liniment"] = "liniment",
  ["a potion of fire"] = "fire",
  ["a mending salve"] = "mending",
  ["a choleric purgative"] = "choleric",
  ["a potion of frost"] = "frost",
  ["a love potion"] = "love",
  ["a phlegmatic purgative"] = "phlegmatic",
  ["an antidote potion"] = "antidote",
  ["a potion of mana"] = "mana",
  ["a melancholic purgative"] = "melancholic",
  ["a regeneration salve"] = "regeneration",
  ["a potion of healing"] = "healing",
  ["a sanguine purgative"] = "sanguine",
  ["dragonsblood oil"] = "dragonsblood",
  ["a potion of bromides"] = "bromides",
  ["vanilla oil"] = "vanilla",
  ["sandalwood oil"] = "sandalwood",
  ["musk oil"] = "musk",
  ["oil of invisibility"] = "invisibility",
  ["jasmine oil"] = "jasmine",
  ["oil of preservation"] = "preservation",
  ["oil of sharpness"] = "sharpness",
  ["the poison aleutian"] = "aleutian",
  ["the poison anerod"] = "anerod",
  ["the poison chansu"] = "chansu",
  ["the poison contortrin"] = "contortrin",
  ["the poison crotamine"] = "crotamine",
  ["the poison dulak"] = "dulak",
  ["the poison escozul"] = "escozul",
  ["the poison hadrudin"] = "hadrudin",
  ["the poison haemotox"] = "haemotox",
  ["the poison ibululu"] = "ibululu",
  ["the poison mellitin"] = "mellitin",
  ["the poison morphite"] = "morphite",
  ["the poison niricol"] = "niricol",
  ["the poison pyrotoxin"] = "pyrotoxin",
  ["the poison saxitin"] = "saxitin",
  ["the poison tetrodin"] = "tetrodin",
  ["the poison dendroxin"] = "dendroxin",
  ["the poison mactans"] = "mactans",
  ["the poison anatine"] = "anatine",
  ["the poison mantakaya"] = "mantakaya",
  ["the poison botulinum"] = "botulinum",
  ["the poison calcise"] = "calcise",
  ["the poison inyoka"] = "inyoka",
  ["the poison charybdon"] = "charybdon",
  ["the poison senso"] = "senso",
  ["empty"] = "empty",
}
